package h.a.a.k;

import h.a.a.d;
import h.a.a.f;
import java.util.Date;
import java.util.List;

/* compiled from: WhereCondition */
public interface i {

    /* compiled from: WhereCondition */
    public static abstract class a implements i {
        public final boolean a;
        public final Object b;

        public a() {
            this.a = false;
            this.b = null;
        }

        public void b(List<Object> list) {
            if (this.a) {
                list.add(this.b);
            }
        }

        public a(Object obj) {
            this.b = obj;
            this.a = true;
        }
    }

    /* compiled from: WhereCondition */
    public static class b extends a {
        public final f c;
        public final String d;

        public b(f fVar, String str, Object obj) {
            if (obj == null || !obj.getClass().isArray()) {
                Class cls = fVar.b;
                StringBuilder stringBuilder;
                if (cls == Date.class) {
                    if (obj instanceof Date) {
                        obj = Long.valueOf(((Date) obj).getTime());
                    } else if (!(obj instanceof Long)) {
                        stringBuilder = new StringBuilder();
                        stringBuilder.append("Illegal date value: expected java.util.Date or Long for value ");
                        stringBuilder.append(obj);
                        throw new d(stringBuilder.toString());
                    }
                } else if (cls == Boolean.TYPE || cls == Boolean.class) {
                    if (obj instanceof Boolean) {
                        obj = Integer.valueOf(((Boolean) obj).booleanValue());
                    } else if (obj instanceof Number) {
                        int intValue = ((Number) obj).intValue();
                        if (!(intValue == 0 || intValue == 1)) {
                            stringBuilder = new StringBuilder();
                            stringBuilder.append("Illegal boolean value: numbers must be 0 or 1, but was ");
                            stringBuilder.append(obj);
                            throw new d(stringBuilder.toString());
                        }
                    } else if (obj instanceof String) {
                        String str2 = (String) obj;
                        if ("TRUE".equalsIgnoreCase(str2)) {
                            obj = Integer.valueOf(1);
                        } else if ("FALSE".equalsIgnoreCase(str2)) {
                            obj = Integer.valueOf(0);
                        } else {
                            stringBuilder = new StringBuilder();
                            stringBuilder.append("Illegal boolean value: Strings must be \"TRUE\" or \"FALSE\" (case insensitive), but was ");
                            stringBuilder.append(obj);
                            throw new d(stringBuilder.toString());
                        }
                    }
                }
                super(obj);
                this.c = fVar;
                this.d = str;
                return;
            }
            throw new d("Illegal value: found array, but simple object required");
        }

        public void a(StringBuilder stringBuilder, String str) {
            h.a.a.j.d.b(stringBuilder, str, this.c);
            stringBuilder.append(this.d);
        }
    }

    /* compiled from: WhereCondition */
    public static class c extends a {
        public final String c;

        public c(String str) {
            this.c = str;
        }

        public void a(StringBuilder stringBuilder, String str) {
            stringBuilder.append(this.c);
        }
    }

    void a(StringBuilder stringBuilder, String str);

    void b(List<Object> list);
}
